package com.oildatacollection.message.protocol;

import com.oildatacollection.message.RecvMessage;
import com.oildatacollection.message.SendMessage;
import io.netty.buffer.ByteBuf;
import javafx.util.Pair;

public interface MessageProtocol {
    /**
     * 协议的解码
     * @return 解码后的消息对象
     */
    Pair<RecvMessage, ByteBuf> decodeMessage(ByteBuf in);

    /**
     * 协议编码
     */
    ByteBuf incodeMessage(SendMessage sdMsg, byte protocolType);

}
